package santeclair.connexion.domaine.parametrage;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import santeclair.connexion.constantes.ConnexionConstantes;

@Entity
@Table(name = "tr_service", catalog = ConnexionConstantes.SCHEMA_NAME)
public class Service implements Serializable {
    /** Serial UID. */
    private static final long serialVersionUID = -4465664404335666157L;

    /**
     * Identifiant du service.
     */
    @Id
    @Column(name = "IDSERVICE")
    private Integer idService;

    /**
     * Libelle du service.
     */
    @Column(name = "LIBELLE", nullable = true, length = 64)
    private String libelle;

    public Integer getIdService() {
        return idService;
    }

    public void setIdService(Integer idService) {
        this.idService = idService;
    }

    public String getLibelle() {
        return libelle;
    }

    public void setLibelle(String libelle) {
        this.libelle = libelle;
    }

    /** {@inheritDoc} */
    @Override
    public boolean equals(Object obj) {
        if (obj instanceof Service) {
            Service serviceAComparer = (Service) obj;
            return this.idService.equals(serviceAComparer.idService);
        }
        return false;
    }

    /** {@inheritDoc} */
    @Override
    public int hashCode() {
        return this.idService;
    }
}
